<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Administration.Modules.BlogControl"
    CodeBehind="Blog.ascx.cs" %>
<%@ Register TagPrefix="nopCommerce" TagName="ToolTipLabel" Src="ToolTipLabelControl.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="NumericTextBox" Src="NumericTextBox.ascx" %>
<div class="section-header">
    <div class="title">
        <img src="Common/ico-content.png" alt="Blog" />
        Manage Blog
    </div>
    <div class="options">
        <input type="button" onclick="location.href='BlogPostAdd.aspx'" value="Add new" id="btnAddNew"
            class="adminButtonBlue" title="Add a new blog entry" />
    </div>
</div>
<p>
</p>
<asp:GridView ID="gvBlogPosts" runat="server" AutoGenerateColumns="False" Width="100%"
    OnPageIndexChanging="gvBlogPosts_PageIndexChanging" AllowPaging="true" PageSize="2">
    <Columns>
        <asp:BoundField DataField="BlogPostID" HeaderText="BlogPostID" Visible="False"></asp:BoundField>
        <asp:TemplateField HeaderText="Blog post title" ItemStyle-Width="40%">
            <ItemTemplate>
                <a href="BlogPostDetails.aspx?BlogPostID=<%#Eval("BlogPostID")%>" title="Edit blog entry">
                    <%#Server.HtmlEncode(Eval("BlogPostTitle").ToString())%>
                </a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Language" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="15%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <a href="LanguageDetails.aspx?NewsID=<%#Eval("LanguageID")%>" title="Manage store languages">
                    <%#((Language)Eval("Language")).Name%></a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Edit" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <a href="BlogPostDetails.aspx?BlogPostID=<%#Eval("BlogPostID")%>" title="Edit blog entry">
                    Edit</a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Created on" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="20%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#DateTimeHelper.ConvertToUserTime((DateTime)Eval("CreatedOn")).ToString()%>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="View comments" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <a href="BlogComments.aspx?BlogPostID=<%#Eval("BlogPostID")%>" title="View blog entry comments">
                    <%#((BlogCommentCollection)Eval("BlogComments")).Count%>
                    comments</a>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
